<%@ page  contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<link href="css/apps/workflow/start-work-input.css" rel="stylesheet" />

<fieldset>
<legend>合同名称</legend>
<dl>
   <dt>
     <textarea id="title"></textarea>
   </dt>
   <dd>
   <button class="btn btn primary" id="doStartWork">
提交
</button>
   </dd>
</dl>

</fieldset>

<script type="text/javascript">
var wname = '${param.workflowName}'||false;
$(function(){
	$("#doStartWork").bind("click",function(){
        if(!wname) {
            alert("请先选择工作流名称!");
            return;
        }
        var title = $("#title").text()||false;
        if(!title){
           alert("请先填写发文单标题!");
           return;
        }
		var pobj = {
				"bean.workflowName" : wname,
				"needTemplate" : true,
				"search":title
			};
		doPost("workflow/start-work!init",$.param(pobj) ,function(){
	         doGet("workflow/proceed/query");
		});

	});

});
</script>